package main

import (
	"fmt"
	"sort"
)

// map key sorted
// func Ints(a []int)
// func Float64s(a []float64s)
// func strings(a []string)
func main() {
	m := make(map[int]string)
	m[0] = "z"
	m[1] = "d"
	m[2] = "b"
	m[3] = "e"
	fmt.Println(m) // map[0:z 1:d 2:b 3:e]

	var keys []int

	for key, _ := range m {
		keys = append(keys, key)
	}

	sort.Ints(keys) // sorted for slice of int

	for _, key := range keys {
		fmt.Println(key, "->", m[key])
	}
	// 0 -> z
	// 1 -> d
	// 2 -> b
	// 3 -> e

}
